package com.huawei.appgallery.purchasehistory.ui.activity;

import android.app.ActionBar;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ImageView;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.huawei.appgallery.foundation.ui.framework.activity.BaseActivity;
import com.huawei.hwid.core.constants.HwAccountConstants;
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
import huawei.widget.HwButton;
import o.ayy;
import o.azb;
import o.cgv;
import o.cst.d;
import o.cst.e;
import o.epr;
import o.epv;
import o.eua;

public class PurchaseHistoryGuideActivity extends BaseActivity {
    public void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
        ayy.ˋ().ˎ(getWindow());
        ॱ(this);
        setContentView(d.ˎ);
        View view = (ImageView) findViewById(e.ॱʼ);
        View view2 = (TextView) findViewById(e.ˋˋ);
        azb.ʻ(view);
        azb.ॱ(view2);
        LayoutParams layoutParams = (LayoutParams) view.getLayoutParams();
        if (epr.ˎ().ॱॱ()) {
            layoutParams.topMargin = 5;
        } else {
            layoutParams.topMargin = epv.ॱ() + 5;
        }
        view.setLayoutParams(layoutParams);
        ActionBar actionBar = getActionBar();
        if (actionBar != null) {
            actionBar.hide();
        }
        ((HwButton) findViewById(e.ʻॱ)).setOnClickListener(new OnClickListener(this) {
            final /* synthetic */ PurchaseHistoryGuideActivity ˎ;

            {
                this.ˎ = r1;
            }

            public void onClick(View view) {
                this.ˎ.ᐝ();
                this.ˎ.finish();
            }
        });
    }

    private void ॱ(@NonNull Activity activity) {
        Window window = activity.getWindow();
        if (cgv.ˎ()) {
            window.clearFlags(HwAccountConstants.FLAG_TRANSLUCENT_STATUS);
            window.getDecorView().setSystemUiVisibility(5894);
            window.setStatusBarColor(0);
            return;
        }
        window.addFlags(HwAccountConstants.FLAG_TRANS_NAVIGATION_BAR);
        window.addFlags(HwAccountConstants.FLAG_TRANSLUCENT_STATUS);
        window.addFlags(WXMediaMessage.DESCRIPTION_LENGTH_LIMIT);
        View decorView = window.getDecorView();
        View findViewById = decorView.findViewById(16908335);
        if (findViewById != null) {
            findViewById.setVisibility(8);
        }
        decorView = decorView.findViewById(16908336);
        if (decorView != null) {
            decorView.setVisibility(8);
        }
    }

    public void onBackPressed() {
        super.onBackPressed();
        ᐝ();
        finish();
    }

    private void ᐝ() {
        eua.ˏ().ˋ("is_first_enter_ purchase_history_activity", false);
    }
}
